<script type="text/javascript">
import axios from 'axios'
import store from './store'
const store_id = 1;
const store_uuid = localStorage.getItem('carWashUuid');
// const store_uuid = 'ed0a5987e683234e4b57fd1a7657002a';
const api = {

  baseurl:'https://ecar.jslcwy.com/',
  user: {
    user: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=user&op=index',  //用户中心
    jssdk: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=Jssdk&op=Jssdk',  //jssdk
     uuid: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=user&op=weqingLogin',  //微信登录
    latlng: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=user&op=updateLatLng',  //更新用户所在经纬度
    qrCode:'/app/index.php?i=2&c=entryApi&m=yimi_car&do=user&op=qrCode',  //推荐二维码
  },
  carCard: {
    list: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=onecard&op=cardList',  //洗车卡列表
    mycard: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=onecard&op=MycardList',  //我的洗车卡
    cardbuy: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=onecard&op=addonecardorder',  //提交洗车卡订单
    pay: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=onecard&op=orderPay',  //支付
  },
  carCoupon: {
    mycoupon: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=coupon&op=MyCouponList',
  },
  carRecharge: { //充值
    list: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=recharge&op=ChargeList',  //我的充值列表
    order: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=recharge&op=addRechargeOrder',  //充值订单
    pay: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=recharge&op=orderPay',  //支付
    record: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=czrecord',  //充值记录
  },
  buddy: {  //小伙伴
    apply: {  //申请小伙伴/修改审核信息
      url: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memWorker&op=SumitAdopt',
    },
    upload_img: {
      url: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memWorker&op=UploadImage',
    },
  },
  address: {  //我的地址、删除地址、新增（编辑）地址
    myAddress: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=myaddr',  //列表
    detele: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=deletemyaddr',  //删除
    change: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=addmyaddr',  //修改
    default: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=defaultmyaddr',  //默认
  },
  carMine: {  //我的爱车
    car: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=mycar',
    add: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=addmycar',
    del: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=deletemycar',
    CateGory: '/app/index.php?i=2&c=entryApi&m=yimi_car&op=car_type&do=personal',
    
  },
  active: {  //活动
    list: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=acticle',  //活动列表
    detail: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=acticledetail',  //活动详情
  },
  order: {
    customer: {
      user: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=user&op=index',  //用户个人中心
      adopt: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memworker&op=MyAdopt', //我的申请
      list: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=order&op=orderList', // 用户订单列表
      info: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=order&op=orderInfo', //订单详情
      add: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=order&op=addOrder', //增加订单
      refund: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=user&op=orderCancelRefund',  //取消订单
      preview: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=order&op=prepare', //订单预览
      comment: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memworker&op=AddComment',//订单评价
      confrimBf: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=order&op=orderBeforeCleanConfirm',  //洗车前外观确认
      confrimAf: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=order&op=orderAfterCleanConfirm',  //洗车后外观确认
    },
    worker: {
      list: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memworker&op=orderList',  //小伙伴订单列表
      receive: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memWorker&op=orderConfirmRefund',  //小伙伴确认接单
      cancel: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memWorker&op=orderCancelRefund',  //小伙伴取消订单
      // cancel: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memWorker&op=orderCancelRefund&',
      info: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memworker&op=orderDetail',  //订单详情
      own: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memworker&op=CountToday',  //个人中心
      upimg: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memWorker&op=UploadImage',  //上传图片
      servce: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memworker&op=orderStart',  //开始服务
      inCome: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memworker&op=EarnList',  //收入明细
      withdraw: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memworker&op=MyTixian',  //提现记录
      Tixian: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memworker&op=Tixian',  //提现
      service: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=memworker&op=commentList',  //客户评论列表
    }
  },
  index: {
    banner: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=banner', //banner图
    search: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=search',  //搜索、首页内容
    appoint: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=yuyue',  //预约
    servceList: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=service',  //服务列表详情
    servceDetail: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=sdetail',  //服务列表详情
    junior: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=junior',  //判断用户是否是小伙伴
    state: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=rest',  //修改状态
    showAdv: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=advertise',  //显示广告
    closeAdv: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=turndownad',  //关闭广告
    guide: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=atcmember',  //申请须知
    policy: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=ordermember',  //取消政策
    care: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=issure',  //  注意事项
    careSure: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=dosure',  //注意事项同意
    serviceStandard: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=servicestandards',  //服务标准
    noticeList: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=dayacticle',  //企业公告列表
    noticeDetail: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=dayacticledetail',  //企业公告详情
    draw: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=tixianacticle',  //提现须知
    userUid: '/app/index.php?i=2&c=entryApi&m=yimi_car&do=personal&op=useruid',  //用户uid
  }
};
function wxConfig () {
  console.log("wxConfig");
}
const enter = {
  prov: '北京',
  city: '北京',
  district: '东城区',
  birth: '1990-01-01',
};
const order = {
  first: true,
  car: {
    id: '0',
    // type: '',
    name: '请选择车辆信息',
    models: '',
    type: '',
    num: '',
  },
  addr: {
    id: '0',
    addr: '请选择地址信息',
    addr_detail: '',
    mobile: '暂无',
    lat: '',
    lng: '',
  },
  worker: {
    id: '',
    name: '请重新选择小伙伴',
    phone: '',
    wallet:0
  },
  service: 1,
  date: '',
  time: '',
  all_pay: '0.00'

};
function axiosGet(url,params){
  axios.get(global.api.order.worker.info,{
    params: params
  })
  .then(function(res){
    console.log("then");
    console.log(res);
  })
  .catch(function(res){
    console.log("catch");
    console.log(res);
  })
}
const jssdk = {};
function getJssdk(){
  var that = this;
  var pathUrl = window.location.href;
  pathUrl = Base64.encode(pathUrl);
  axios.get(that.api.user.jssdk,{
    params: {
      url: pathUrl,
    }
  })
  .then(function(res){
    console.log("getJssdk then");
    console.log(res);
    that.jssdk = res.data.content;
  })
  .catch(function(res){
    console.log("getJssdk catch");
    console.log(res);
  })
}
const order_id = 0;
const order_wid = 0;
const is_show = true;
export default{
  store_id,
  store_uuid,
  api,
  wxConfig,
  enter,
  order,
  axiosGet,
  jssdk,
  getJssdk,
  order_id,
  order_wid,
  is_show,
}
</script>